﻿using System.Net.DnsToolkit.Packet;
using System.Net.DnsToolkit.Packet.Records;
using System.Net.DnsToolkit.Serializer.Stream.Extension;

namespace System.Net.DnsToolkit.Serializer.Stream.Writer.Record {
    public class RecordAWriter : IRecordWriter<System.IO.Stream> {

        public QTypeEnum QTypeEnum { get { return QTypeEnum.A; } }

        public void Write(IRecord record, System.IO.Stream destination, ICompressionContext compression) {
            
            var a = (IRecordA)record;
            if (compression == null) { /* do nothing */
            }
            destination.WriteIPv4(a.Address);

        }

    }
}
